var setting = {
    data : {
        simpleData : {
            enable : true,
            idKey : "id",
            pIdKey : "parentId",
            rootPId : -1,
        },
        key : {
            url : "nourl"
        }
    },
    check: {
        enable: true,
        chkStyle: "checkbox",
        chkboxType: { "Y": "", "N": "" }
    },
};
var data = [{"id":1,"name":"四川","parentId":0},{"id":2,"name":"成都","parentId":1}]
var ztree;
$(function(){
    var type = GetQueryString("type");
    if(type == 1){
        $("#myTab").find("li").eq(0).addClass("active");
        $("#myTab").find("li").eq(1).removeClass("active");
        $("#basic").addClass("in active");
        $("#area").removeClass("in active");
    }else{
        $("#myTab").find("li").eq(1).addClass("active");
        $("#myTab").find("li").eq(0).removeClass("active");
        $("#area").addClass("in active");
        $("#basic").removeClass("in active");
    }
    ztree = $.fn.zTree
        .init($("#cityZtree"), setting, data);
})

function ckeckedTreeNodes(){
    var nodes = ztree.getCheckedNodes(true);
    if(nodes.length == 0){
        vm.rightContentList = [];
    }
    for(var i=0;i<nodes.length;i++){
        var obj = {};
        obj.name=nodes[i].name;
        obj.id=nodes[i].id;
        vm.rightContentList = [];
        vm.rightContentList.push(obj);
    }
}